const Utils = {
    isIntNumber: (a, b, val) => {
        for (let i = 0; i < val.length; i++) {
            if (!(val[i] >= '0' && val[i] <= '9')) {
                return "请输入整数";
            }
        }

        try {
            val = parseInt(val);
        } catch (error) {
            return "请输入整数";
        }

        console.log("val = ", val)
        if (val >= a && val <= b) return "";
        return "请输入范围在[" + (a === -Number.MAX_VALUE ? "-INF" : a) + "," + (b === Number.MAX_VALUE ? "INF" : b) + "]中的整数";
    },
    isFloatNumber: (a, b, val) => {
        for (let i = 0; i < val.length; i++) {
            if (!((val[i] >= '0' && val[i] <= '9') || val[i] === '.' || val[i] === '-')) {
                return "请输入实数";
            }
        }
        try {
            val = parseFloat(val);
        } catch (error) {
            return "请输入实数";
        }
        console.log("val = ", val)
        if (val >= a && val <= b) return "";
        return "请输入范围在[" + (a === -Number.MAX_VALUE ? "-INF" : a) + "," + (b === Number.MAX_VALUE ? "INF" : b) + "]中的实数";
    }
}

const constraintInput = {

    jsheq: (props, val) => {
        // console.log("jsheq", val)
        return Utils.isIntNumber(0, Number.MAX_VALUE, val);
    },
    jsqqsy: (props, val) => {
        return Utils.isIntNumber(1, Number.MAX_VALUE, val);
    },
    jsqjsy: (props, val) => {
        return Utils.isIntNumber(1, Number.MAX_VALUE, val);
    },
    xmyyq: (props, val) => {
        return Utils.isIntNumber(0, Number.MAX_VALUE, val);
    },
    zlczjrl: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    jlczjrl: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    gfxtrl: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    jsqqsn: (props, val) => {
        return Utils.isIntNumber(0, Number.MAX_VALUE, val);
    },
    jsqqsy: (props, val) => {
        return Utils.isIntNumber(1, 12, val);
    },
    zbjtrfs: (props, val) => {
        return "";
    },
    zbjzxttzbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    zbjtrje: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    jsqlxjsfs: (props, val) => {
        return "";
    },
    jsqlx: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    fndtz: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    dwkwjttz: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    gdzcbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    wxzcbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    qtzcbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    kdksjjsfs: (props, val) => {
        return "";
    },
    kdksj: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    sbf: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    jagcf: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    kdksj_qtfy: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    jszdzdfy: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    kdksj_show: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    zbcbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    zbjjzsyl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    hyjzsylq: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    hyjzsylh: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },

    // ----

    ldzjjsfs: (props, val) => {
        return "";
    },
    dwqwzb: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    ldzj: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    pdldzjbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    ldzjzbjbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    ldzjdkll: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    dqdkll: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    ydhkq: (props, val) => {
        return Utils.isIntNumber(0, Number.MAX_VALUE, val);
    },
    hbfxfs: (props, val) => {
        return "";
    },
    hbje: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    cqdkll: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },

    // ---
    ygsl: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    rgnpjgz: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    gdzccz: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    gdzczjnx: (props, val) => {
        return Utils.isIntNumber(1, Number.MAX_VALUE, val);
    },
    wxzctxnx: (props, val) => {
        return Utils.isIntNumber(1, Number.MAX_VALUE, val);
    },
    qtzctxnx: (props, val) => {
        return Utils.isIntNumber(1, Number.MAX_VALUE, val);
    },
    flfjqt: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    ywf: (props, val) => {
        return "";
    },
    xlf: (props, val) => {
        return "";
    },
    bxf: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    clf: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    qtfyx: (props, val) => {
        return Utils.isIntNumber(0, 10, val);
    },
    qtfy: (props, val) => {
        return "";
    },
    lxxzkh: (props, val) => {
        return Utils.isFloatNumber(-Number.MAX_VALUE, Number.MAX_VALUE, val);
    },
    tffzfwf: (props, val) => {
        return Utils.isFloatNumber(-Number.MAX_VALUE, Number.MAX_VALUE, val);
    },

    // ---
    bwfdfs: (props, val) => {
        return "";
    },
    swdljsfs: (props, val) => {
        return "";
    },
    ndxlyxss: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    sjljsfs: (props, val) => {
        return "";
    },
    sjl: (props, val) => {
        return "";
    },
    tysnsjl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    znsjl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    bwms: (props, val) => {
        return "";
    },
    zfzybl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    swdj: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    zydj: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    swdj_show: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    zzssl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    zzsjzjtbl: (props, val) => {
        return "";
    },
    sfzxsmsjbzc: (props, val) => {
        return "";
    },
    mjns: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    jbns: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    cdmbtshsr: (props, val) => {
        return Utils.isFloatNumber(0, Number.MAX_VALUE, val);
    },
    qtsr: (props, val) => {
        return "";
    },
    zlzczc: (props, val) => {
        return "";
    },
    zlfsr: (props, val) => {
        return "";
    },
    jszrhsysr: (props, val) => {
        return "";
    },
    qysdssl: (props, val) => {
        return "";
    },
    cswhjss: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    jyffj: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    fdyygjjbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    ryyygjjbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    yflrbl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },
    lcoezxl: (props, val) => {
        return Utils.isFloatNumber(0, 100, val);
    },

}
export default constraintInput